package com.wyz.serviceImpl;

import com.wyz.entity.Admin;
import com.wyz.mapper.AdminMapper;
import com.wyz.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class AdminServiceImpl implements AdminService {
    @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
    @Autowired
    public AdminMapper adminMapper;

    @Override
    public Admin login(String name, String pwd) {
        Map map = new HashMap();
        map.put("id",name);
        map.put("password",pwd);
        return adminMapper.login(map);
    }

    /**
     * 增加管理员信息
     * @param admin
     * @return
     */
    public int addManager(Admin admin) {
        return adminMapper.addManager(admin);
    }

    /**
     * 删除管理员信息
     * @param id
     * @return
     */
    public int delManager(int id) {
        return adminMapper.delManager(id);
    }

}
